package com.njwb.day09.exception;

import java.util.InputMismatchException;
import java.util.Scanner;

public class Test01 {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		try{
			System.out.print("请输入被除数:");
			int num1 = in.nextInt();
			System.out.print("请输入除数:");
			int num2 = in.nextInt();
			System.out.println(String.format("%d / %d = %d",
					num1, num2, num1/ num2));
			String str= null ;
			str.equals("abc");
		}catch(InputMismatchException e) {
			e.printStackTrace();
		}catch(ArithmeticException e) {
			e.printStackTrace();
			System.out.println("message:"+e.getMessage());
		}catch(Exception e) {
			e.printStackTrace();
		}finally {
			//无论是否发生异常 (无论异常是否捕获)，此处代码一定会执行
			System.out.println("感谢使用本程序！");
		}
		System.out.println("程序结束...........");
	}
}
